package com.jf.cloud.service.sysmanager.constant;

import java.util.HashMap;
import java.util.Map;

import com.jf.cloud.service.sysmanager.common.util.DateUtil;

/**
 * TODO 配置整个系统的 图片路径 前缀
 */
public class ImagePath {

	/**
	 * 注意： 1.0 开发的时候在你本机配置 hosts 文件 指定 img.3yx.com 的位置，并且此文件不能随意修改 2.0 正式部署
	 * 请确认配置好了二级域名，或ip
	 */

	// 图片需要用到的 路径配置
	public static String FOCUS_PATH = "http://imgcdn.3yx.com/";

	// 商品图片
	public final static String PATH_PUB_GOODS_PIC = "/gts/pubg/goodsImg/";

	// 公告图片
	public final static String PATH_AFFICHE_PIC = "/gts/pubg/afficheImg/";
	
	// 用户头像
	public final static String PATH_USER_PHOTO = "/gts/pubg/userPhoto/";
	
	// 战队图片
	public final static String PATH_TEAM_PHOTO = "/gts/pubg/teamPhoto/";
	
	// 战队广告图片
	public final static String PATH_TEAM_AD = "/gts/pubg/team/";
	
	// 违法举报图片
	public final static String PATH_INFORM_PHOTO = "/gts/pubg/informPhoto/";
	
	// 实名信息图片
	public final static String PATH_REAL_NAME_MIG = "/gts/pubg/realNameImg/";
	
	// KindEditorHTML在线编辑器 图片前缀
	public final static String PATH_KE = "/images/ke/";

	/**
	 * 图片上传的类型,对应不同的路劲
	 */
	public static String T_AFFICHE_PIC = "AFFICHE_PIC";

	/**
	 * 图片上传的类型,对应不同的路劲
	 */
	public static String T_PUB_GOODS_PIC = "GOODS_PIC";
	
	/**
	 * 用户头像图片
	 */
	public static String T_USER_PHOTO = "userPhoto";
	
	/**
	 * 战队头像图片
	 */
	public static String T_TEAM_PHOTO = "teamPhoto";
	
	/**
	 * 战队广告图片
	 */
	public static String T_TEAM_AD = "teamAd";
	
	/**
	 * 违法举报图片
	 */
	public static String T_INFORM_PHOTO = "informPhoto";
	
	/**
	 * 实名信息图片
	 */
	public static String T_REAL_NAME_IMG = "realNameImg";


	public static Map<String, String> paMap = new HashMap<String, String>();
	static {
		paMap.put(T_PUB_GOODS_PIC, PATH_PUB_GOODS_PIC);
		paMap.put(T_AFFICHE_PIC, PATH_AFFICHE_PIC);
		paMap.put(T_USER_PHOTO, PATH_USER_PHOTO);
		paMap.put(T_TEAM_PHOTO, PATH_TEAM_PHOTO);
		paMap.put(T_TEAM_AD, PATH_TEAM_AD);
		paMap.put(T_INFORM_PHOTO, PATH_INFORM_PHOTO);
		paMap.put(T_REAL_NAME_IMG, PATH_REAL_NAME_MIG);
	}

	/**
	 * 按类型获取 图片存放路径 2013 10 规划 各文件夹统一添加 年月作为分包
	 */
	public static String getPath(String type) {
		String basePath = PATH_PUB_GOODS_PIC;
		String datePath = DateUtil.getCurrentDateTime("yyyyMM");
		if (paMap.containsKey(type)) {
			basePath = paMap.get(type);
		}
		return basePath + datePath + "/";
	}
}